Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

treewide/nixos: remove with lib; part 4 #335631

Merged
merged 148 commits into from
Sep 15, 2024

Conversation

Stunkymonkey
Copy link
Contributor

@Stunkymonkey Stunkymonkey commented Aug 18, 2024

Description of changes

part of #208242

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.11 Release Notes (or backporting 23.11 and 24.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@github-actions github-actions bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` labels Aug 18, 2024
@Stunkymonkey Stunkymonkey force-pushed the treewide-nixos-remove-with-lib-4 branch 3 times, most recently from 816d6d5 to 1a98258 Compare August 18, 2024 16:36
@github-actions github-actions bot added the 6.topic: k3s Kubernates distribution (https://k3s.io/) label Aug 18, 2024
@Stunkymonkey Stunkymonkey force-pushed the treewide-nixos-remove-with-lib-4 branch 2 times, most recently from 88d6199 to 457ffd9 Compare August 18, 2024 17:18
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild 10.rebuild-linux: 1-10 labels Aug 18, 2024
@philiptaron philiptaron self-requested a review August 19, 2024 19:35
@SigmaSquadron SigmaSquadron self-requested a review August 24, 2024 23:55
@Stunkymonkey Stunkymonkey force-pushed the treewide-nixos-remove-with-lib-4 branch from 457ffd9 to 8b90114 Compare August 27, 2024 18:41
@ofborg ofborg bot added the 2.status: merge conflict This PR has merge conflicts with the target branch label Aug 27, 2024
@Stunkymonkey Stunkymonkey force-pushed the treewide-nixos-remove-with-lib-4 branch 3 times, most recently from 697ceeb to ca0690b Compare August 28, 2024 19:28
@ofborg ofborg bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Aug 28, 2024
Copy link
Contributor

@philiptaron philiptaron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few things, but overall looking good.

nixos/modules/misc/wordlist.nix Outdated Show resolved Hide resolved
nixos/modules/services/backup/postgresql-wal-receiver.nix Outdated Show resolved Hide resolved
nixos/modules/services/backup/sanoid.nix Outdated Show resolved Hide resolved
nixos/modules/services/backup/syncoid.nix Outdated Show resolved Hide resolved
nixos/modules/services/cluster/k3s/default.nix Outdated Show resolved Hide resolved
nixos/modules/services/networking/bird-lg.nix Outdated Show resolved Hide resolved
nixos/modules/services/networking/firewall.nix Outdated Show resolved Hide resolved
nixos/modules/services/networking/jitsi-videobridge.nix Outdated Show resolved Hide resolved
nixos/modules/system/boot/tmp.nix Outdated Show resolved Hide resolved
@Stunkymonkey Stunkymonkey force-pushed the treewide-nixos-remove-with-lib-4 branch 2 times, most recently from 27803cd to e14383d Compare August 29, 2024 23:10
@Stunkymonkey Stunkymonkey force-pushed the treewide-nixos-remove-with-lib-4 branch from e14383d to aaf69cb Compare August 29, 2024 23:17
Copy link
Contributor

@philiptaron philiptaron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whew

@philiptaron
Copy link
Contributor

@Stunkymonkey -- unlike part 3, I did review this.

@SigmaSquadron SigmaSquadron added the 12.approvals: 1 This PR was reviewed and approved by one reputable person label Sep 6, 2024
@Stunkymonkey
Copy link
Contributor Author

@philiptaron thanks for reviewing. sorry I was ill for a few days.

I still have to improve the commit messages for all commits.

should i split the bigger commits into separate PRs?

@wegank wegank added the 2.status: merge conflict This PR has merge conflicts with the target branch label Sep 10, 2024
@Stunkymonkey Stunkymonkey marked this pull request as ready for review September 10, 2024 21:52
@Mic92 Mic92 force-pushed the treewide-nixos-remove-with-lib-4 branch from c40ebb5 to f1dfc8d Compare September 15, 2024 08:47
@Mic92
Copy link
Member

Mic92 commented Sep 15, 2024

I rebased the pull request since it has been open for quite a while.

@Mic92 Mic92 merged commit 6bb59d8 into NixOS:master Sep 15, 2024
9 of 10 checks passed
@Mic92
Copy link
Member

Mic92 commented Sep 15, 2024

Re-basing found one bug.

philiptaron pushed a commit that referenced this pull request Sep 15, 2024
This fixes a regression that was introduced in #335631
@Ma27
Copy link
Member

Ma27 commented Sep 16, 2024

@Mic92 @Stunkymonkey was the same broken script used as in the PRs before?

@Mic92
Copy link
Member

Mic92 commented Sep 16, 2024

I don't know what script was used here.

@caffineehacker
Copy link
Contributor

It looks like the change to nixos/modules/services/networking/cloudflared.nix:276 is wrong. It was changed to lib.filterConfig, but filterConfig is defined on line 268 and is probably what was intended to be used. There are several other changes to lib.filterConfig in that file as well.

Error when evaluating:

</snip>
         at /nix/store/zp7936gnwcnls8vc9das6a9c8307gn74-source/lib/strings.nix:2322:18:

         2321|   */
         2322|   isStringLike = x:
             |                  ^
         2323|     isString x ||

       error: attribute 'filterConfig' missing

       at /nix/store/zp7936gnwcnls8vc9das6a9c8307gn74-source/nixos/modules/services/networking/cloudflared.nix:276:26:

          275|
          276|             fullConfig = lib.filterConfig {
             |                          ^
          277|               tunnel = name;

@Mic92
Copy link
Member

Mic92 commented Sep 16, 2024

I diffed the diff with actual lib functions:

% diff /tmp/func /tmp/actual | grep '-'
--- /tmp/func   2024-09-16 20:55:18.978511697 +0200
+++ /tmp/actual 2024-09-16 20:54:46.727947889 +0200
@@ -1,136 +1,445 @@
-anymore."
-attrsets.filterAttrsRecursive
-attrsets.mapAttrsToList
-cli.toGNUCommandLineShell
-escapeStr
-escapeSystemdPath
-escapeUnitName
-filterConfig
-filterForward
-generators.mkKeyValueDefault
-generators.mkValueStringDefault
-generators.toINI
-generators.toKeyValue
-maintainers.bachp
-maintainers.joachifm
-maintainers.markuskowa
-maintainers.phfroidmont
-modules.mkAliasAndWrapDefsWithPriority
-nixosSystem
-systems`
-systems.elaborate
-systems.equals
-systems.examples.aarch64-multiplatform''
-systems.parsedPlatform
-teams.beam.members
-teams.freedesktop.members
-teams.jitsi.members
-teams.pantheon.members
-types.anything
-types.attrs
-types.attrsOf
-types.bool
-types.commas
-types.either
-types.enum
-types.functionTo
-types.int
-types.ints.between
-types.ints.positive
-types.lines
-types.listOf
-types.nonEmptyListOf
-types.nullOr
-types.oneOf
-types.package
-types.path
-types.path.check
-types.pkgs
-types.port
-types.separatedString
-types.str
-types.submodule
-types.unspecified

@Mic92
Copy link
Member

Mic92 commented Sep 16, 2024

Looks like those are wrong:

-escapeStr
-escapeSystemdPath
-escapeUnitName
-filterConfig
-filterForward

was already fixed.

@Mic92
Copy link
Member

Mic92 commented Sep 16, 2024

Looks like they got and only #342370 is pending.

@Mic92
Copy link
Member

Mic92 commented Sep 16, 2024

This is how I computed the diff to prevent this issue in future:

git diff a15394d51a40315f749ee87728a2e5b6461456f3..b4b8ef5bb6f1d8b31aedf33b0962fd31fc2e09a9 | grep -o -E 'lib\.[^ ;)]+' | sed -e 's/lib\.//' | sort -u > /tmp/func
nix eval --json -f . --apply builtins.attrNames lib | jq -r '.[]' | sort -u > /tmp/actual
diff /tmp/func /tmp/actual | grep '-'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: k3s Kubernates distribution (https://k3s.io/) 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild 10.rebuild-linux: 1-10 12.approvals: 1 This PR was reviewed and approved by one reputable person
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants